package com.zc.operator.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.BaseEntity;
import com.zc.operator.domain.ChargeStation;
import com.zc.operator.domain.CustomChargeStation;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

/**
 * 场站Mapper接口
 *
 * @author glb
 * @date 2023-05-17
 */
public interface ChargeStationMapper {
    /**
     * 查询场站
     *
     * @param chargeStationId 场站主键
     * @return 场站
     */
    public ChargeStation selectChargeStationByChargeStationId(Long chargeStationId);

    public ChargeStation selectChargeStationByChargeStationCode(String chargeStationCode);

    /**
     * 查询场站列表
     *
     * @param chargeStation 场站
     * @return 场站集合
     */
    List<ChargeStation> selectChargeStationList(ChargeStation chargeStation);

    List<ChargeStation> selectChargeStationListAPI(ChargeStation chargeStation);

    /**
     * 新增场站
     *
     * @param chargeStation 场站
     * @return 结果
     */
    int insertChargeStation(ChargeStation chargeStation);

    /**
     * 修改场站
     *
     * @param chargeStation 场站
     * @return 结果
     */
    int updateChargeStation(ChargeStation chargeStation);

    /**
     * 删除场站
     *
     * @param chargeStationId 场站主键
     * @return 结果
     */
    int deleteChargeStationByChargeStationId(Long chargeStationId);

    /**
     * 批量删除场站
     *
     * @param chargeStationIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteChargeStationByChargeStationIds(Long[] chargeStationIds);

    /**
     * 根据客户openid获取客户收藏的站点
     *
     * @param customCode 客户openid
     * @return 站点集合
     */
    List<ChargeStation> getUserCollectStationList(String customCode);

    List<Map<String, Object>> getCollectStationByCode(@Param("customCode") String customCode, @Param("chargeStationId") Long chargeStationId);

    /**
     * 添加客户收藏站点
     *
     * @param customChargeStation 客户收藏
     * @return 站点集合
     */
    boolean inserCollectStation(CustomChargeStation customChargeStation);

    /**
     * 取消客户收藏站点
     *
     * @param customChargeStation 客户收藏
     * @return 站点集合
     */
    boolean delCollectStation(CustomChargeStation customChargeStation);

    /**
     * 获取场站状态统计
     */
    @DataScope(deptAlias = "s")
    Map<String, Integer> getStatus(BaseEntity entity);
}
